package com.kingsoft.dc.khaos.module.spark.util

import com.kingsoft.dc.khaos.KhaosContext
import com.kingsoft.dc.khaos.extender.meta.api.{AuthRequest, DmRequest}
import com.kingsoft.dc.khaos.module.spark.constants.SchedulerConstants
import com.kingsoft.dc.khaos.util.Logging

/**
  * Created by jing on 19/7/6.
  */
object TenantUtils extends Logging {
  def buildAkskRequest(kc: KhaosContext):DmRequest = {
    val request = new DmRequest
    request.setUrl(kc.conf.getString(SchedulerConstants.TENANT_SERVER_URL))
    request.setTenantId(kc.conf.getString(SchedulerConstants.TENANT_ID))
    val authRequest: AuthRequest = new AuthRequest()
    authRequest.setAuthUrl(kc.conf.getString(SchedulerConstants.AUTH_SERVER_KEY))
    request.setAuthRequest(authRequest)
    request
  }

}
